home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / VOXEL.ZIP / GRAFIX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-13  |  4.8 KB  |  169 lines

  1.  
  2. #include <io.h>
  3. #include <stdio.h>
  4. #include <dos.h>             /* has MK_FP macroo in it */
  5. #include <stdlib.h>     // for malloc. This must be here or malloc will
  6.                         // FAIL, if d==NULL will not catch it!! so always include this!
  7.  
  8. #define NOT_FOUND -1
  9. #define debug 1                  /* debugging on/off */
  10.  
  11. /* this is the pic size structure for display info only*/
  12. struct pic_size
  13. {
  14. int width;
  15. int height;
  16. };
  17.  
  18. typedef struct pic_size SIZE_INFO;
  19.  
  20.  
  21.  
  22. struct head                  /* pcx header */
  23. {
  24.  char manufacturer,          /* always 10 */
  25.       version,               /* always 5 */
  26.       encoding,              /* 1 = run length encoding */
  27.       bits_per_pixel;        /* always 8 */
  28.  int  xmin,                  /* x,y min/max of the pic */
  29.       ymin,
  30.       xmax,
  31.       ymax,
  32.       hres,
  33.       vres;
  34.  char colormap[48],          /* for ega, we dont use it */
  35.       reserved,
  36.       nplanes;              /* better be 1 */
  37.  int  bytes_per_line,
  38.       pal_type;             /* 1 for color b/w , 2= greyscale */
  39.  char filler[58];
  40.  };
  41.  
  42.  typedef struct head PCX_HEADER;
  43.  
  44.  
  45.  
  46.  
  47. /* Palette control */
  48. void G_SetColor(unsigned char index,char r,char g,char b);
  49. void G_GetColor(char index,char *r,char *g,char *b);
  50. void G_SetPal(char *pal,int start,int numcols);
  51. void G_GetPal(char *pal,int start,int numcols);
  52. void G_FadeInPal(char *npal,int speed);
  53. void G_FadeOutPal(char *npal,int speed); 
  54. int  G_FindColor(char r,char g,char b);
  55. void G_DisplayPal(); 
  56.  
  57.  
  58.  
  59.  
  60.  
  61. /* From SCR.C */
  62.  
  63. void Int13_mode();
  64. void Text_mode();
  65. void G_plot_pixel(int x,int y,unsigned char color, char far *back);
  66. void G_Centered_vertical_line(int height,unsigned char color,int column,char far *back);
  67. void G_Set_column_color(int column,unsigned char color,char far *back); 
  68. void G_Set_scanline_color(int line,unsigned char color,char far *back);
  69. void G_Set_screen_color(unsigned char color,char far *back);
  70.  
  71. //int  GL_GetPixel(int x,int y);
  72. //void GL_FillBox(int x1,int y1,int x2,int y2,char color);
  73. //void GL_FilledBox(int x1,int y1,int w,int h,char color);
  74. //void GL_Rectangle(int x1,int y1,int x2,int y2,char color);
  75. //void GL_Line(int x1,int y1,int x2,int y2,char color);
  76. //void GL_Circle(int x,int y,int radius);
  77.  
  78. //void GL_SetDrawingBuffer(char *buffer);
  79. //unsigned char *GL_MakeDrawingBuffer(void);
  80. //void GL_FreeDrawingBuffer(unsigned char *buffer);
  81. //void GL_UpdateScreen(unsigned char *buffer);
  82.  
  83. void G_WaitRetrace();  
  84. //void GL_PutImage(int x,int y,struct image_s *image);
  85. //void GL_GetImage(int x,int y,struct image_s *image);
  86. //void GL_PutSprite(int x,int y,int sx,int sy,unsigned char *image);
  87.  
  88.  
  89. //void GL_Putc( int c );
  90. //void GL_Puts( char *str);
  91. //int GL_TextXSize(char *str);
  92. //int GL_LoadFont( char* font );
  93. //void GL_ItalicsOn(void);
  94. //void GL_ItalicsOff(void);
  95. //void GL_GotoXY( int x, int y );
  96. //int GL_GetX(void);
  97. //int GL_GetY(void);
  98. //void GL_BoldOff(void);
  99. //void GL_BoldOn(void);
  100. //void GL_PutText(int x,int y,char *str);
  101. //void GL_TextColor(char color);
  102. //void GL_TextShadow(char color,int offsetx,int offsety);
  103. //void GL_TextUnderline(char color,int offsety);
  104. //void GL_TextBold(int thickness);
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. //void GL_PutText(int x,int y,char *str);
  116. //void GL_TextColor(char color);
  117. //void GL_TextShadow(char color,int offsetx,int offsety);
  118. //void GL_TextUnderline(char color,int offsety);
  119. //void GL_TextBold(int thickness);
  120. //int  GL_TextXSize(char *str);
  121. //int  GL_TextYSize(char *str);
  122. //int  GL_LoadFontFile(char *fname);
  123. //void GL_UseFont(int fontID);
  124.  
  125. /* ACTIVE FOR MODE X ONLY (no effect in Mode 13H): */
  126. //void GL_SetVisualPage(int page);
  127. //void GL_SetActivePage(int page);
  128. //int  GL_GetVisualPage(void);
  129. //int  GL_GetActivePage(void);
  130.  
  131.  
  132. /* image.c */
  133. char *G_load_pcx(char *filename, int load_palette,SIZE_INFO *size); 
  134. char *pcx_decode(FILE *handle, int load_palette,SIZE_INFO *size);
  135.  
  136. //int GL_Gif( char* file, char * buffer, char * pal, int* width, int* height );
  137.  
  138.  
  139. /* glkey.c */
  140. //void GL_AddKey(int down,int up);
  141. //void GL_TrapKeys(void);
  142. //void GL_ReleaseKeys(void);
  143.  
  144. //struct GL_KEYMAP                        /* This holds a list of key scan   */
  145. //{                                       /* codes that we want to trap.     */
  146. //   unsigned char downcode;              /* Code when key is pressed        */
  147. //   unsigned char upcode;                /* Code when key is released       */
  148. //};
  149.  
  150. //extern unsigned char *ScrBuffer;
  151. //extern struct GL_KEYMAP GL_Keys[32];
  152. //extern char   GL_NumKeys;
  153. //extern char   GL_KeyStat[32];           /* You can test if a given key is   */
  154.  
  155. //#define random(num)(int)(((long)rand()*(num))/(RAND_MAX+1))
  156. //#define randomize()     srand((unsigned)time(NULL))
  157.  
  158.               /*
  159. void disable();
  160. void enable();
  161.                 */
  162.  
  163. #pragma aux disable =  "cli"
  164. #pragma aux enable =   "sti"
  165.  
  166.  
  167.  
  168.  
  169.